@echo off
echo 测试文件处理功能
echo.

echo 1. 启动后端服务...
cd backend
start /B mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dserver.port=8080" > backend.log 2>&1

echo 等待服务启动...
timeout /t 10 /nobreak > nul

echo 2. 测试API端点...
echo.

echo 测试健康检查:
curl -X GET http://localhost:8080/api/analysis/health
echo.
echo.

echo 测试服务状态:
curl -X GET http://localhost:8080/api/analysis/status
echo.
echo.

echo 测试处理已下载文件API (需要先有下载的文件):
echo curl -X POST http://localhost:8080/api/analysis/process/downloaded ^
echo   -H "Content-Type: application/json" ^
echo   -d "{\"deviceSn\":\"test123\",\"phone\":\"13800138000\"}"
echo.

echo 按任意键继续...
pause > nul

echo 3. 停止后端服务...
taskkill /F /IM java.exe > nul 2>&1

echo 测试完成！
pause
